﻿using Fozzy.Being;
using Fozzy.Object;


namespace Fozzy.Gedcom
{
    /// <summary>
    /// One family group. 
    /// </summary>
    public class Parents                                            : Fozzy.Being.Parents
    {
        #region States

        #endregion

        #region Properties
        #endregion

        #region Constructeur
            public Parents(_Element node)                            : this(new Couple<Being.Father, Being.Mother, Being.Person>(new Being.Father(node), new Being.Mother(node)), new Marriage(node))
            {}
            public Parents(Couple<Being.Father, Being.Mother, Being.Person> couple, Marriage marriage)
                                                                    : base(couple, marriage)
            {}
        #endregion

            //public override void Export(Fozzy.File file)
            //{
            //    base.Export(file)                                   ;
            //    First   .Export(file)                               ;
            //    Marriage.Export(file)                               ;
            //}

            //private void ExportMarriage(Person partnerLeft, Person partnerRight, SpouseRelationship relationship)
            //{
            //    // PartnerLeft.
            //    if (partnerLeft != null && partnerLeft.Gender == Gender.Male)
            //        WriteLine(1, "HUSB", string.Format(CultureInfo.InvariantCulture,
            //        "@{0}@", idMap.Get(partnerLeft.Id)));

            //    if (partnerLeft != null && partnerLeft.Gender == Gender.Female)
            //        WriteLine(1, "WIFE", string.Format(CultureInfo.InvariantCulture,
            //        "@{0}@", idMap.Get(partnerLeft.Id)));

            //    // PartnerRight.
            //    if (partnerRight != null && partnerRight.Gender == Gender.Male)
            //        WriteLine(1, "HUSB", string.Format(CultureInfo.InvariantCulture,
            //        "@{0}@", idMap.Get(partnerRight.Id)));

            //    if (partnerRight != null && partnerRight.Gender == Gender.Female)
            //        WriteLine(1, "WIFE", string.Format(CultureInfo.InvariantCulture,
            //        "@{0}@", idMap.Get(partnerRight.Id)));

            //    if (relationship == null)
            //        return;

            //    // Marriage.
            //    if (relationship.SpouseModifier == SpouseModifier.Current)
            //    {
            //        WriteLine(1, "MARR", "Y");

            //        // Date if it exist.
            //        if (relationship.MarriageDate != null)
            //            WriteLine(2, "DATE", relationship.MarriageDate.Value.ToShortDateString());
            //    }

            //    // Divorce.
            //    if (relationship.SpouseModifier == SpouseModifier.Former)
            //    {
            //        WriteLine(1, "DIV", "Y");

            //        // Date if it exist.
            //        if (relationship.DivorceDate != null)
            //            WriteLine(2, "DATE", relationship.DivorceDate.Value.ToShortDateString());
            //    }
            //}
    }
}
